GdkOffscreenWindow: Implement gdk_window_get_frame_extents()
authorTristan Van Berkom <tristanvb@openismus.com>
Sat, 6 Apr 2013 08:09:27 +0000 (17:09 +0900)
committerTristan Van Berkom <tristanvb@openismus.com>
Sat, 6 Apr 2013 08:16:09 +0000 (17:16 +0900)
This avoids crashes in gtk_window_get_position() whenever the GdkWindow
is offscreen.

gdk/gdkoffscreenwindow.c

index aed09e0e83097d92756c9a580811a2ae8d408421..c765209032d94d39042cf20b9eabdc32611607a4 100644 (file)
@@ -713,6 +713,16 @@ gdk_offscreen_window_process_updates_recurse (GdkWindow *window,
   _gdk_window_process_updates_recurse (window, region);
 }
 
+static void
+gdk_offscreen_window_get_frame_extents (GdkWindow    *window,
+                                       GdkRectangle *rect)
+{
+  rect->x = window->x;
+  rect->y = window->y;
+  rect->width = window->width;
+  rect->height = window->height;
+}
+
 static void
 gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
 {
@@ -763,7 +773,7 @@ gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
   impl_class->set_startup_id = gdk_offscreen_window_set_string;
   impl_class->set_transient_for = gdk_offscreen_window_set_transient_for;
   impl_class->get_root_origin = NULL;
-  impl_class->get_frame_extents = NULL;
+  impl_class->get_frame_extents = gdk_offscreen_window_get_frame_extents;
   impl_class->set_override_redirect = NULL;
   impl_class->set_accept_focus = NULL;
   impl_class->set_focus_on_map = gdk_offscreen_window_set_boolean;